{extend name="_layout/default" /}

{block name="header"}
<link rel="stylesheet" href="/static/css/new_css20160428.css">
<link rel="stylesheet" href="/static/js/plugs/waterfall/wf.css">
<style>
    .film-source a{color: inherit;text-decoration: none}
    .color-btfilm{color: #19b393}
    .btfilm-btn{background-color: #1ab394 !important;color: #fff !important;}

    table {
        border-spacing: 0;
        border-collapse: collapse;
        border: none;
        padding: 0;
        margin: 0;
    }
    .olt {
        width: 100%;
        padding: 0;
        margin-bottom: 3px;
    }
    .olt td {
        border-bottom: 1px dashed #DDDDDD;
        font-size: 14px;
        padding: 5px 0 5px 10px;
        word-wrap: break-word;
        word-break: break-word;
    }
    tr {
        display: table-row;
        vertical-align: inherit;
        border-color: inherit;
    }
    .olt a{
        display: inline-block;
        width: 350px;
        max-height: 20px;
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
    }
    .olt a:visited {
        color: #666699;
        text-decoration: none;
    }
    .olt a:link {
        color: #37a;
        text-decoration: none;
    }
    .bigstar{display: none}
</style>

{/block}


{block name="main"}
<div class="mdui-container">
    <h2>{$film.title}{notempty name="film.year"}（{$film.year}){/notempty}</h2>
    <div class="mdui-row mdui-row-gapless subjectwrap clearfix">
        <div class="mdui-col-xs-3">
            <img class="mdui-img-fluid" src="{:url('bridge/douban')}?url={:urlencode($film->cover)}" title="点击看更多海报" alt="{$film.title}"/>
        </div>
        <div class="mdui-col-xs-5" id="info">
            {notempty name="$film.directors"}
            <p>
                <span class="pl">导演</span>:
                <span class="attrs">{:implode(' / ', $film->directors)}</span>
            </p>
            {/notempty}
            {notempty name="$film.writers"}
            <p>
                <span class="pl">编剧</span>:
                <span class="attrs">{:implode(' / ', $film->writers)}</span>
            </p>
            {/notempty}
            {notempty name="$film.casts"}
            <p>
                <span class="pl">主演</span>:
                <span class="attrs">{:implode(' / ', $film->casts)}</span>
            </p>
            {/notempty}
            {notempty name="$film.genres"}
            <p>
                <span class="pl">类型</span>:
                <span class="attrs">{:implode(' / ', $film->durations)}</span>
            </p>
            {/notempty}
            {notempty name="film.countries"}
            <p>
                <span class="pl">制片国家/地区</span>:
                <span class="attrs">{:implode(' / ', $film->countries)}</span>
            </p>
            {/notempty}
            {notempty name="film.languages"}
            <p>
                <span class="pl">语言</span>:
                <span class="attrs">{:implode(' / ', $film->languages)}</span>
            </p>
            {/notempty}
            {notempty name="film.pubdates"}
            <p>
                <span class="pl">上映日期</span>:
                <span class="attrs">{:implode(' / ', $film->pubdates)}</span>
            </p>
            {/notempty}
            {notempty name="film.aka"}
            <p>
                <span class="pl">又名</span>:
                <span class="attrs">
                    {volist name="film.aka" id="vo"}
                    <a href="{:url('/search')}?keyword={$vo}" target="_blank">{$vo}</a>/
                    {/volist}
                </span>
            </p>
            {/notempty}
            {notempty name="film.durations"}
            <p>
                <span class="pl">片长</span>:
                <span class="attrs">{:implode(' / ', $film->durations)}</span>
            </p>
            {/notempty}
        </div>
        <div class="mdui-col-xs-3" id="interest_sectl">
            <div class="rating_wrap clearbox" rel="v:rating">
                <div class="clearfix">
                    <div class="rating_logo ll">豆瓣评分</div>
                </div>
                <div class="rating_self clearfix" typeof="v:Rating">
                    <strong class="ll rating_num" property="v:average">{$film->rating['average']|default=0}</strong>
                    <span property="v:best" content="10.0"></span>
                    <div class="rating_right ">
                        <div class="ll bigstar bigstar45"></div>
                        <div class="rating_sum">
                            <span property="v:votes">{$film->rating['ratings_count']|default=0}</span>人评价
                        </div>
                    </div>
                </div>
                <div class="ratings-on-weight">
                    <div class="item">
                        <span class="stars5 starstop" title="力荐">5星</span>
                        <div class="power" style="width:{$ratings['details'][5]['width']|default=0}px"></div>
                        <span class="rating_per">{$ratings['details'][5]['percent']|default=0}%</span>
                    </div>
                    <div class="item">
                        <span class="stars4 starstop" title="推荐">4星</span>
                        <div class="power" style="width:{$ratings['details'][4]['width']|default=0}px"></div>
                        <span class="rating_per">{$ratings['details'][4]['percent']|default=0}%</span>
                    </div>
                    <div class="item">
                        <span class="stars3 starstop" title="还行">3星</span>
                        <div class="power" style="width:{$ratings['details'][3]['width']|default=0}px"></div>
                        <span class="rating_per">{$ratings['details'][3]['percent']|default=0}%</span>
                    </div>
                    <div class="item">
                        <span class="stars2 starstop" title="较差">2星</span>
                        <div class="power" style="width:{$ratings['details'][2]['width']|default=0}px"></div>
                        <span class="rating_per">{$ratings['details'][2]['percent']|default=0}%</span>
                    </div>
                    <div class="item">
                        <span class="stars1 starstop" title="很差">1星</span>
                        <div class="power" style="width:{$ratings['details'][1]['width']|default=0}px"></div>
                        <span class="rating_per">{$ratings['details'][1]['percent']|default=0}%</span>
                    </div>
                </div>
            </div>
            <div class="rating_betterthan">

            </div>
        </div>
    </div>


    {notempty name="film.videos"}
    <div class="related-info" style="margin-bottom:20px;">
        <div  class="related-pic" style="clear: both">
            <h2>{$film.title}在线播放</h2>
            <div>
                {volist name="film.videos" id="vo"}
                <div class="mdui-chip">
                    <span class="mdui-chip-icon" style="background-color: #fff">{$key + 1}</span>
                    <span class="mdui-chip-title">
                        <a class="color-333" target="_blank" href="{:url('/vip')}?url={:urlencode($vo['sample_link'])}" title="{$film.title}在线播放">在线播放</a>
                    </span>
                </div>
                {/volist}
            </div>
        </div>
    </div>
    {/notempty}


    {notempty name="sources"}
    <div class="related-info" style="margin-bottom:20px;">
        <div  class="related-pic" style="clear: both">
            <h2>{$film.title}的相关资源</h2>
            <div>
                <table class="olt">
                    <tbody>
                    {volist name="sources" id="vo"}
                    <tr>
                        <td class="pl"><a href="{:url('/film/' . $vo['id'])}" title="{$vo['title']}">{$vo['title']}</a></td>
                        <td class="pl"><span>来自</span>{$vo.site_name}</td>
                        <td class="pl"><span></span></td>
                        <td class="pl"><span>{$vo.c_time}</span></td>
                    </tr>
                    {/volist}
                    </tbody>
                    <tfoot>
                    <tr>
                        <td colspan="4">
                            <a target="_blank" href="{:url('/search')}?keyword={$keywords}" class="j a_show_login colbutt" title="{$keywords}电影" style="width: 100%">
                                <span>查看更多关于{$film.title}的相关资源</span>
                            </a>
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>
    {/notempty}


    <div class="related-info" style="margin-bottom:-10px;">
        <h2>
            <i class="">{$film.title}的剧情简介</i>
            · · · · · ·
        </h2>
        <div class="indent" id="link-report">
            {$film.summary}
        </div>
    </div>


    <div id="related-pic" class="related-pic" style="clear: both">
        <h2>{$film.title}的剧照</h2>
        <div id="layer-photos">

        </div>
        <ul class="related-pic-bd narrow" >
            {volist name="film.photos" id="photo"}
            <li>
                <img  src="{:url('/bridge/douban')}?url={:urlencode($photo)}" alt="{$film.title}剧照" title="{$film.title}剧照">
            </li>
            {/volist}
        </ul>
    </div>
</div>
{/block}


{block name="footer"}
<script src="//cdnjs.loli.net/ajax/libs/mdui/0.4.2/js/mdui.min.js"></script>
<script src="/static/js/plugs/clipboard/clipboard.min.js"></script>
<script src="/static/js/plugs/waterfall/wf.js"></script>
<script>
    let $$ = mdui.JQ;
    $$(function () {
        let clipboard = new Clipboard('.lx-download');
        clipboard.on('success', function(e) {
            e.clearSelection();
        });
        clipboard.on('error', function(e) {
            console.error('Trigger:', e.trigger);
        });

        $$('.lx-download').on('click', function (e) {
            let inst = new mdui.Dialog('#lx-download-dialog');
            inst.open();
        });

        setTimeout(function () {
            let imgs = [];
            $$('ul.related-pic-bd > li > img').each(function () {
                imgs.push({'src':this.src, width: this.width, height: this.height});
            });
            let wtf = new WaterFull('#layer-photos', {
                type: 3,
                urlField: 'src'
            });
            wtf.create(imgs);
            $$('ul.related-pic-bd').hide();
        }, 3000);
    });

</script>

{/block}